home *** CD-ROM | disk | FTP | other *** search
- -- 2000.03.19
- -- Clive Green <clivegreen@atlas.co.uk>
-
- ------------------------------------------------------------------------------------------------------
-
- -- url hyperlink access:
-
- ------------------------------------------------------------------------------------------------------
-
- -- declare properties:
- property main -- main code directory object
- property DUNbindings -- a list of binding IDs which resolve to DUN dependent methods
-
- ------------------------------------------------------------------------------------------------------
-
- on new me,L
-
- -- (1) extract and check arguments:
-
- -- check for a parameter list:
- if ilk(L) <> #propList then return [#error:#noParamListSupplied, #msg:"onlineService:new"]
-
- -- a reference to the parent codebase is REQUIRED:
- main = L[#main]
- if (ilk(main) <> #instance) then return [#error:#noMainObjectSupplied, #msg:"onlineService:new"]
-
- --------------------
-
- -- pull the list of known DUN bindings:
- dm = main.getDataManager()
- DUNbindings = dm.getData([#set:#settings,#item:#DUNbindings])
-
- -- pass back my address:
- return me
-
- ----------------------------------------------------------------------------------------------------
-
- on DUNbindingAvailable me,b
-
- -- is the bindingID b even listed as DUN-dependent?
- if not getPos(DUNbindings,b) then return 1
-
- --------------------
-
- -- obtain conditions testing service:
- sm = main.getServiceManager()
- cs = sm.getService(#conditionsService)
-
- --------------------
-
- -- Dial up networking is simply assumed for the Mac version of the programme:
- if cs.testCondition(#macintoshHost) then return 1
-
- -- the DUN test to be performed varies slightly according to the Win OS version being used:
- if cs.testCondition(#windows95) then n = #DUNavailableWin95
- else n = #DUNavailableWin
-
- -- so, is dial-up networking available for the current OS?
- if cs.testCondition(n) then return 1
-
- --------------------
-
- -- this binding can't work:
- return 0
-
- ----------------------------------------------------------------------------------------------------
-
- on showHelp me
-
- -- show a platform-specific html frameSet:
- um = main.getUtilityMethods()
- p = um.thePlatform()
-
- -- which help page?
- f = symbol(p & "HelpURL") -- (ie: #pcHelpURL)
-
- --------------------
-
- -- obtain the (partial) filepath for the help page:
- dm = main.getDataManager()
- uL = dm.getData([#set:#filePaths,#item:f])
- u = uL[#filePath]
-
- -- the path u is given relative to the root directory of the projector/stub -
- -- we need to prefix the filepath accordingly:
- u = dm.getRootPath() & u
-
- -- attempt to display url; return the result to the caller:
- return me.showURL([#url:u])
-
- ----------------------------------------------------------------------------------------------------
-
- on showURL me,L
-
- -- need a list of parameters:
- if ilk(L) <> #propList then return 0
-
- -- extract URL supplied:
- url = L[#url]
- if not stringP(url) then return 0
-
- --------------------
-
- -- parse the filePath for the current platform:
- um = main.getUtilityMethods()
- url = um.parseFilePath(url)
-
- --------------------
-
- -- background the projector layer:
- xm = main.getXtrasManager()
- bud = xm.getBuddyAPIxtra()
- if (ilk(bud) <> #instance) then return bud
-
- bud.bkgndStage()
-
- --------------------
-
- -- display url's target using the host's currently selected browser application:
- goToNetPage(url)
-
- return url
-
- ----------------------------------------------------------------------------------------------------